package homework1;

import java.util.ArrayList;

public class Test1 {
    public static void main(String[] args) {
        // 获取班级实例
        Classroom classroom = Classroom.getClassroom();

        //  创建学生对象
        Student student1 = new Student("张三", "1", 18);
        Student student2 = new Student("李四", "2", 19);

        // 添加学生到班级
        classroom.addStudent(student1);
        classroom.addStudent(student2);

        // 获取班级中的学生列表
        ArrayList<Student> students = classroom.getStudents();

        // 打印学生信息
        for (Student student : students) {
            System.out.println("姓名：" + student.getName() + "，学号：" + student.getStudentId() + "，年龄：" + student.getAge());
        }
    }
}
